﻿//技能脚本   作者：枫叶   QQ：1848350048
//承接开服一条龙
var 点卷图标 = "#fUI/CashShop/CashItem/0#";
var 消费元宝 = 700;
var MaxLevel = 5;
var newskillId = Array(
	14101004,
	12101003
);

function start() {
	status = -1;

	action(1, 0, 0);
}


function action(mode, type, selection) {
	if (status == 0 && mode == 0) {
		cm.dispose();
		return;
	}
	if (mode == 1) {
		status++;
	} else {
		status--;
	}
	if (status == 0) {

		cm.getPlayer().setOneTimeLog("了解二段跳和快速移动");

		text = "";
		text += "    \t" + 彩虹 + "  #e#d 技 能 学 习 #k#n  #r  " + 彩虹 + "#b#k#n\r\r\n";
		text += "#d 每个技能首次学习" + 消费元宝 + "元宝，升级100元宝#k\r\n"

		text += "#r点击学习好技能，即可在键盘设定F12键拿取技能使用！#k\r\n"

		for (i = 0; i < newskillId.length; i++)//
		{
			if (newskillId[i] != 0) {
				text += " #L" + newskillId[i] + "##s" + newskillId[i] + "##q" + newskillId[i] + "#  [#r学习#k] 当前等级:" + cm.getPlayer().getSkillLevel(newskillId[i]) + " - 最高等级:" + MaxLevel + "#l \r\n"
			}
		}
		cm.sendSimple(text);

	}
	else if (status == 1) {
		if (selection > 10000) {
			var nowSkilLevel = cm.getPlayer().getSkillLevel(selection);
			var palyerid = cm.getPlayer().getId();

			if (nowSkilLevel + 1 > MaxLevel) {
				cm.新键盘上技能(palyerid, 88, 1, selection, MaxLevel);
				cm.sendOk("该技能已经学满了!可以从键盘F12拿技能了。");
				cm.dispose();
				return;
			}

			if (nowSkilLevel != 0) {
				消费元宝 = 100; // 升级均为100元宝
			}

			if (cm.getmoneyb() >= 消费元宝) {

				cm.setmoneyb(-消费元宝);
				// MaxLevel = cm.getPlayer().getMasterLevel(selection);

				text = "";

				cm.新键盘上技能(palyerid, 88, 1, selection, nowSkilLevel + 1);
				text += "成功学习#s" + selection + "##q" + selection + "#  当前等级:" + (nowSkilLevel + 1) + ' / 满级:' + MaxLevel
				text += "   可以从键盘F12拿技能了。"
				cm.sendOk(text);
				cm.dispose();
				return;
			}
			else {
				cm.sendOk("元宝不足无法学习该技能！");
				oversend();
			}

		}
	}

}

function oversend() {
	cm.dispose();
	return;
}
var 彩虹 = "#fEffect/ItemEff/1071085/effect/walk1/2#";
